package daydayup.gateway.api;

public class WxUtils {

	 public static String APPID = "wxdeb3a20d35ed4459";
	 public static String URL = "api.xuebanweilai.cn/";
	 public static String API_KEY = "MaiBoWeiLaiXiaoLiangLaoBan201808";
	 public static String CODE = "";
	 public static String NOTIFY_URL = "api.xuebanweilai.cn/";
	
	 String WX_CODE_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +APPID
			+ "&redirect_uri=" + URL + 
			"&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect";
	
	 String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + APPID
			+ "&secret=" +API_KEY +"&code=" + CODE +"&grant_type=authorization_code";
	
	public static String getWxCodeUrl(String appid, String url) {
		return "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +appid
				+ "&redirect_uri=" + url + 
				"&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect";
		
	}
	
	public static String getAcccessTokenUrl(String appid, String secret, String code) {
		return "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + appid
				+ "&secret=" +secret +"&code=" + code +"&grant_type=authorization_code";
	}
}
